<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>添加用户</title>
        <script src="js/jquery-3.3.1.js"></script>
        <script>
           function addUser() {
                $.post("user/addUser",$("#addForm").serialize(),function (info) {
                    if(info.flag){
                        alert(info.data);
                        location.href = "user_list.html";
                    }
                });
           }
        </script>
    </head>
    <body>
        <h3>添加用户</h3>
        <form id="addForm">
            用户名:<input type="text" name="username"><br/>
            密码:<input type="password" name="password"><br/>
            邮箱:<input type="text" name="email"><br/>
            性别:
            <input type="radio" name="sex" value="男">男
            <input type="radio" name="sex" value="女">女<br/>
            爱好:
            <input type="checkbox" name="love" value="1">篮球
            <input type="checkbox" name="love" value="2">乒乓球
            <input type="checkbox" name="love" value="3">羽毛球<br/>
            <input type="button" value="添加" onclick="addUser()">
        </form>
    </body>
</html>
